{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "78e05398",
   "metadata": {},
   "source": [
    "# NICOLA: The Northern Ireland Longitudinal Study of Ageing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ce8610a3",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-28T20:11:09.821022Z",
     "iopub.status.busy": "2025-07-28T20:11:09.821022Z",
     "iopub.status.idle": "2025-07-28T20:11:22.772946Z",
     "shell.execute_reply": "2025-07-28T20:11:22.771920Z"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/markdown": [
       ">Last modified: 28 Jul 2025"
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "import sys\n",
    "import os\n",
    "sys.path.append(os.path.abspath('../../scripts/'))\n",
    "from data_doc_helper import LPSSource as SS, last_modified\n",
    "ss = SS(\"NICOLA\")\n",
    "last_modified()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "462c277c",
   "metadata": {},
   "source": [
    "## 1. Summary"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "5656af1c",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-28T20:11:22.781995Z",
     "iopub.status.busy": "2025-07-28T20:11:22.780995Z",
     "iopub.status.idle": "2025-07-28T20:11:22.791831Z",
     "shell.execute_reply": "2025-07-28T20:11:22.790710Z"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "As the first large scale longitudinal study of ageing in Northern Ireland, NICOLA aims to help gain a better understanding of the factors that affect social and health outcomes in the older Northern Ireland population. Over time, it will inform new prevention strategies, new interventions, new models of health and social care delivery and ultimately contribute to how society should change to ensure a better quality of life for all."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ss.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3ac1ed7a",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-28T20:11:22.799796Z",
     "iopub.status.busy": "2025-07-28T20:11:22.798797Z",
     "iopub.status.idle": "2025-07-28T20:11:24.374828Z",
     "shell.execute_reply": "2025-07-28T20:11:24.372809Z"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">\n",
       "#T_14084 th {\n",
       "  text-align: left;\n",
       "}\n",
       "#T_14084_row0_col0, #T_14084_row0_col1, #T_14084_row1_col0, #T_14084_row1_col1, #T_14084_row2_col0, #T_14084_row2_col1, #T_14084_row3_col0, #T_14084_row3_col1, #T_14084_row4_col0, #T_14084_row4_col1, #T_14084_row5_col0, #T_14084_row5_col1, #T_14084_row6_col0, #T_14084_row6_col1, #T_14084_row7_col0, #T_14084_row7_col1, #T_14084_row8_col0, #T_14084_row8_col1, #T_14084_row9_col0, #T_14084_row9_col1, #T_14084_row10_col0, #T_14084_row10_col1, #T_14084_row11_col0, #T_14084_row11_col1, #T_14084_row12_col0, #T_14084_row12_col1 {\n",
       "  text-align: left;\n",
       "}\n",
       "</style>\n",
       "<table id=\"T_14084\" style=\"font-size: 14px\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th id=\"T_14084_level0_col0\" class=\"col_heading level0 col0\" >Series Descriptor</th>\n",
       "      <th id=\"T_14084_level0_col1\" class=\"col_heading level0 col1\" >Series-specific Information</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row0_col0\" class=\"data row0 col0\" >Citation (APA)</td>\n",
       "      <td id=\"T_14084_row0_col1\" class=\"data row0 col1\" >Queen's University Belfast,  School of Medicine, Dentistry and Biomedical Sciences, Centre for Public Health. (2021). <i>NICOLA: The Northern Ireland Longitudinal Study of Ageing.</i> UK Longitudinal Linkage Collaboration (UK LLC).  <a href=\"https://doi.org/10.71760/ukllc-series-00015\" rel=\"noopener noreferrer\" target=\"_blank\">https://doi.org/10.71760/ukllc-series-00015</a></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row1_col0\" class=\"data row1 col0\" >Download Citation</td>\n",
       "      <td id=\"T_14084_row1_col1\" class=\"data row1 col1\" > <a href=\"https://api.datacite.org/application/vnd.citationstyles.csl+json/10.71760/ukllc-series-00015\" rel=\"noopener noreferrer\" target=\"_blank\">Citeproc JSON</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"https://api.datacite.org/application/x-bibtex/10.71760/ukllc-series-00015\" rel=\"noopener noreferrer\" target=\"_blank\">BibTeX</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"https://api.datacite.org/application/x-research-info-systems/10.71760/ukllc-series-00015\" rel=\"noopener noreferrer\" target=\"_blank\">RIS</a></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row2_col0\" class=\"data row2 col0\" >Owner</td>\n",
       "      <td id=\"T_14084_row2_col1\" class=\"data row2 col1\" >Queen's University Belfast</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row3_col0\" class=\"data row3 col0\" >Cohort</td>\n",
       "      <td id=\"T_14084_row3_col1\" class=\"data row3 col1\" >8504</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row4_col0\" class=\"data row4 col0\" >Age at Recruitment</td>\n",
       "      <td id=\"T_14084_row4_col1\" class=\"data row4 col1\" >50 years +</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row5_col0\" class=\"data row5 col0\" >Geographical Coverage - Nations</td>\n",
       "      <td id=\"T_14084_row5_col1\" class=\"data row5 col1\" >Northern Ireland</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row6_col0\" class=\"data row6 col0\" >Geographical Coverage - Regions</td>\n",
       "      <td id=\"T_14084_row6_col1\" class=\"data row6 col1\" >Nationwide</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row7_col0\" class=\"data row7 col0\" >Start Date</td>\n",
       "      <td id=\"T_14084_row7_col1\" class=\"data row7 col1\" >2014</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row8_col0\" class=\"data row8 col0\" >Permitted Linkages</td>\n",
       "      <td id=\"T_14084_row8_col1\" class=\"data row8 col1\" >See  <a href=\"https://guidebook.ukllc.ac.uk/docs/lps/linkages/lps_linkages\" rel=\"noopener noreferrer\" target=\"_blank\">here</a></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row9_col0\" class=\"data row9 col0\" >Inclusion in Linkages</td>\n",
       "      <td id=\"T_14084_row9_col1\" class=\"data row9 col1\" >Consent</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row10_col0\" class=\"data row10 col0\" >Cohort Profile</td>\n",
       "      <td id=\"T_14084_row10_col1\" class=\"data row10 col1\" > <a href=\"https://doi.org/10.1093/ije/dyad026\" rel=\"noopener noreferrer\" target=\"_blank\">10.1093/ije/dyad026</a></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row11_col0\" class=\"data row11 col0\" >LPS Homepage</td>\n",
       "      <td id=\"T_14084_row11_col1\" class=\"data row11 col1\" ><p><a href=\"https://www.qub.ac.uk/sites/NICOLA/\">qub.ac.uk</a></p></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td id=\"T_14084_row12_col0\" class=\"data row12 col0\" >Build a Data Request</td>\n",
       "      <td id=\"T_14084_row12_col1\" class=\"data row12 col1\" > <a href=\"https://explore.ukllc.ac.uk/\" rel=\"noopener noreferrer\" target=\"_blank\">https://explore.ukllc.ac.uk/</a></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x21869020a70>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ss.info_table()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e5f92a29",
   "metadata": {},
   "source": [
    "## 2. Linkage Rates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "0bf24587",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-28T20:11:24.383359Z",
     "iopub.status.busy": "2025-07-28T20:11:24.382397Z",
     "iopub.status.idle": "2025-07-28T20:11:24.394876Z",
     "shell.execute_reply": "2025-07-28T20:11:24.393305Z"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "Linkage rates will be displayed for NICOLA in due course."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ss.linkages_plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eaed1f79",
   "metadata": {},
   "source": [
    "## 3. Documentation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "6bba7b7e",
   "metadata": {
    "execution": {
     "iopub.execute_input": "2025-07-28T20:11:24.402836Z",
     "iopub.status.busy": "2025-07-28T20:11:24.401840Z",
     "iopub.status.idle": "2025-07-28T20:11:24.412067Z",
     "shell.execute_reply": "2025-07-28T20:11:24.411048Z"
    },
    "tags": [
     "remove-input"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/markdown": [
       "We are currently building a documentation storage system which will host useful documents related to datasets and data owners. We will surface these documents on Guidebook."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ss.documentation()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "jupbook",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}